<?php if(!defined('IN_APP')) exit('Access Denied');?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
	<meta charset="UTF-8">
	<title>充值</title>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
	<meta name="format-detection" content="telephone=no,email=no,adress=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" />  
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="<?php echo THEME_PATH;?>styles/swiper.min.css">
	<link rel="stylesheet" href="<?php echo THEME_PATH;?>styles/reset.css">
	<link rel="stylesheet" href="<?php echo THEME_PATH;?>styles/common.css">
	<link rel="stylesheet" href="<?php echo THEME_PATH;?>styles/style.css">	
</head>
<body>
	<!-- S header -->
	<header>
		<a href="/index.php?m=user&c=home&a=index" class="headerL iconfont">&#xe69f;</a>
		<h1>充值</h1>
	</header>
	<!-- E header -->
	<!-- 内容 -->
	<div class="withdraw-content">
		<div class="withdraw-item flex flex-pack-justify">
			<label>充值方式</label>
			<select name="bank" id="AreaId" class="select">
			<option value="0">请选择</option>
			
				<option value="1">支付宝</option>
				<option value="2">银行卡</option>
			
			</select>
		</div>
		<div class="withdraw-wrap">
			<!-- <div class="withdraw-item flex flex-pack-justify">
				<div>ID</div>
				<div>666</div>
			</div> -->
			<div class="withdraw-money">
				<h2>充值金额</h2>
				<div class="flex sum-box">
					<label>&yen;</label>
					<input type="text" class="flex-1" name="price">
				</div>
			</div>
			<a href="javascript:;" class="btn" onclick="payment()">充值</a>
		</div>
	</div>

	<div class="popup_shade"></div>
	<!-- S 付款弹窗 -->
	<div class="payment_popUp">
		<div class="flex flex-pack-justify card-wrap">
			<label>储蓄卡</label>
			<div class="numb">农业银行（0456）</div>
		</div>
		<dl class="money">
			<dt>￥</dt>
			<dd style="margin-top: 0;font-size: 25px;" class="dd_price">23.30</dd>
		</dl>
		<div class="transaction-password">
			<h3>请输入交易密码</h3>
			<div class="password-wrap flex flex-pack-justify">
				<input type="password" maxlength="1" name="password_1" onkeyup="this.value=this.value.replace(/\D/g,'')">
				<input type="password" maxlength="1" name="password_2" onkeyup="this.value=this.value.replace(/\D/g,'')">
				<input type="password" maxlength="1" name="password_3" onkeyup="this.value=this.value.replace(/\D/g,'')">
				<input type="password" maxlength="1" name="password_4" onkeyup="this.value=this.value.replace(/\D/g,'')">
				<input type="password" maxlength="1" name="password_5" onkeyup="this.value=this.value.replace(/\D/g,'')">
				<input type="password" maxlength="1" name="password_6" onkeyup="this.value=this.value.replace(/\D/g,'')">
			</div>
		</div>
		<a href="javascript:;" class="btn submit">提交</a>
	</div>
	<!-- E 付款弹窗 -->
	
	<script src="<?php echo THEME_PATH;?>js/jquery-1.8.3.min.js"></script>
	<script src="<?php echo THEME_PATH;?>js/swiper.min.js"></script>
	<script src="/statics/js/layer/layer.js"></script>
	<script>

		//付款
		function payment(){
			var price = $("input[name='price']").val();
			var bank = $("#AreaId option:selected").val();
			// console.log(bank);
			if(bank == '0'){
				layer.msg('请选择充值方式');
				return;
			}
			var reg = /^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$/;
			if(price == '' || price == 0){
				layer.msg('充值金额不能为空');
				return;
			}
			if(!reg.test(price)){
				layer.msg('请输入正确格式的金额');
				return;
			}
			console.log(1111);
			window.location.href = "/index.php?m=user&c=home&a=chongzhi1&price="+price+"&type="+bank;

			// var bank_info =  $("#AreaId").find("option:selected").text();
			// $('.dd_price').text(price);
			// $('.numb').text(bank_info);
			// $(".popup_shade,.payment_popUp").show();

		}
	// $('.submit').click(function(){
	// 	var password_1 = $("input[ name='password_1' ] ").val();
	// 	var password_2 = $("input[ name='password_2' ] ").val();
	// 	var password_3 = $("input[ name='password_3' ] ").val();
	// 	var password_4 = $("input[ name='password_4' ] ").val();
	// 	var password_5 = $("input[ name='password_5' ] ").val();
	// 	var password_6 = $("input[ name='password_6' ] ").val();
		
	// 	// if(password_1 === ''||password_2 === '' || password_3 === ''|| password_4 === '' || password_5 === '' || password_6 === ''){
	// 	// 	layer.msg('密码不能为空');
	// 	// 	setTimeout(function(){
	// 	// 				location.reload();
	// 	// 			},1000);
	// 	// 	return;
	// 	// }
	// 	// var password = password_1+""+password_2+""+password_3+""+password_4+""+password_5+""+password_6;
	// 	// var price = $("input[name='price']").val();
	// 	// var bank = $("#AreaId option:selected").val();
	// 	// $.ajax({
	// 	// 	url:"/index.php/?m=user&c=home&a=check_chongzhi",
	// 	// 	type:'post',
	// 	// 	data:{password:password,price:price,id:bank},
	// 	// 	dataType:'json',
	// 	// 	success:function(data){
	// 	// 		if(data.status ==0){
	// 	// 			layer.msg(data.info);
	// 	// 			setTimeout(function(){
	// 	// 				location.reload();
	// 	// 			},1000);
	// 	// 		}else{
	// 	// 			// $(".popup_shade,#payment_popUp").hide();
	// 	// 			// $(".popup_shade,#success").show();
	// 	// 			layer.msg(data.info);
	// 	// 			setTimeout(function(){
	// 	// 			// location.href = "/index.php?m=user&c=trade&a=index";
	// 	// 			window.location.reload();
	// 	// 			},1000);
			
	// 	// 			// layer.close(index);
	// 	// 			return;
	// 	// 		}
	// 	// 	}
	// 	// });
	// })
		
	</script>
</body>